<div class="layui-card">
    <div class="layui-card-header"><b>个人信息</b></div>
    <div class="layui-card-body">
        <div id="form">
            <form class="" style="padding: 30px">
                <div class="row">
                    <div class="form-group col-md-6">
                        <label>原密码<span style="color: red">*</span></label>
                        <input class="form-control" type="password" name="password0" placeholder="" autocomplete="off">
                    </div>
                    <div class="form-group col-md-6">
                        <label>新密码<span style="color: red">*</span></label>
                        <input class="form-control" type="password" name="password1" placeholder="" autocomplete="off">
                    </div>
                </div>
                <div class="row" style="text-align:center;">
                    <button class="layui-btn " lay-submit lay-filter="form">立即提交</button>
                </div>
            </form>
        </div>
    </div>
</div>
<script>
    layui.use('form', function () {
        var form = layui.form;
        form.on('submit(form)', function (obj) {
            var data = $("form").serialize();
//        alert(data)
            $.post("/user/updatePass", data, function (data) {
                if (Number(data.code) == 0) {
                    $("#content").load('');
                    layer.msg("操作成功", {icon: 1});
                }
                else {
                    layer.msg(data.msg, {icon: 2})
                }
            })
            return false;
        })
    })
</script>